#!/bin/sh

# Set these paths appropriately

BIN=/home/user/Downloads/TreeTagger/bin
CMD=/home/user/Downloads/TreeTagger/cmd
LIB=/home/user/Downloads/TreeTagger/lib

OPTIONS="-token -lemma -sgml -pt-with-lemma"

TOKENIZER=${CMD}/tokenize.pl
TAGGER=${BIN}/tree-tagger
ABBR_LIST=${LIB}/english-abbreviations
PARFILE=${LIB}/english.par
LEXFILE=${LIB}/english-lexicon.txt

$TOKENIZER -e -a $ABBR_LIST $* |
# remove empty lines
grep -v '^$' |
# external lexicon lookup
perl $CMD/lookup.perl $LEXFILE |
# tagging
$TAGGER $OPTIONS $PARFILE | 
perl -pe 's/\tV[BDHV]/\tVB/;s/IN\/that/\tIN/;'
